import { useEffect } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Button } from "react-native-paper";
import request from 'umi-request';


const Setting = ()=>{

  const pageLoad = ()=>{
    console.log('pageLoad');
  }

  const submit = async ()=>{
    console.log('submit');
    const param = {
      name:'玉林',
      n:1,
      apiKey:'016320468193-8900120171e-c7ae4a546a8',
    }
    const res = await request.get('https://api.linhun.vip/doc/zytq.html',{params:param})
    console.log(res);
  }



  useEffect(()=>{
    pageLoad()
  },[])
    return(
        <View style={styles.container}>
        <Button icon="camera" onPress={submit}>
            Press me
            </Button>
      </View>
    )
}

const styles = StyleSheet.create({
    container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
    },
  });

export default Setting;